Installing and Upgrading PowerShell 7 on Windows
I originally saw a prompt when launching Windows PowerShell that said: "Install the latest PowerShell for new features and improvements!", and I assumed it was just a pending update. It wasn't until I clicked it that I realized versions before 5 and after 6 are actually different products. The Windows prompt to install the latest PowerShell page contains this statement:
Do I need to install PowerShell 7? No, unless you have specific feature requirements for PowerShell 7, you do not need to install it.
Since the official documentation explicitly states that it is not necessary to install it without specific requirements, I ignored it. However, I later found that the Copilot CLI script tools required PowerShell v6 or later, providing only experimental support for Windows PowerShell 5.1 with version check blocks. I had to go back and install it, and decided to write this guide for future maintenance.
Differences between Windows PowerShell and PowerShell 7
Windows PowerShell and PowerShell 7 are completely different product lines (the current latest versions are 5.1 and 7.6 respectively, with 7.6 being an LTS version). For detailed explanations, please refer to the official PowerShell documentation.
- Underlying Architecture: Windows PowerShell is based on the closed-source .NET Framework and is limited to Windows systems; PowerShell 7 is based on open-source .NET (currently 7.6 uses .NET 10) and can run cross-platform on Windows, Linux, macOS, and even in Docker containers.
- Lifecycle and Positioning: Windows PowerShell has stopped new feature development and is in maintenance-only mode; no new features will be added.
- Default Encoding and Encoding Issues: PowerShell 7 uses UTF-8 (without BOM) as the default encoding for all output, solving the encoding issues that frequently occurred in the Windows PowerShell era when handling plain text files, Chinese characters, or interacting with Git.
- Executable Isolation: Both can coexist on the same computer without interfering with each other. The Windows PowerShell executable is named
powershell.exe, while PowerShell 7 is renamed topwsh.exeto distinguish it.
Installation Guide
WinGet automatically sets environment variables (adding pwsh.exe to PATH) after installation, so no manual configuration is required.
Search for available versions:
winget search --id Microsoft.PowerShellInstall the latest stable version (e.g., 7.6):
winget install --id Microsoft.PowerShell --source wingetUpgrade to the latest version with one command:
winget upgrade --id Microsoft.PowerShellUninstall:
winget uninstall --id Microsoft.PowerShellGet-Help Documentation Mechanism
Installing PowerShell only installs the "execution engine." Detailed offline documentation (including examples and parameter explanations) is not bundled by default and must be downloaded separately. If you want to view examples using -Examples or view full parameter descriptions using -Detailed but get no output, it is likely that the help files have not been downloaded.
If you need complete example documentation, there are two ways:
Online Query: Add the
-Onlineparameter after the command (e.g.,Get-Help Get-Process -Online) to open the browser and view the official web-based documentation, which does not take up local space.Download Offline Files: Run the following command as an administrator to download the help files to your local machine:
powershellUpdate-Help -UICulture zh-tw, en-US -Force -ErrorAction SilentlyContinue
Explanation of parameters:
-UICulture zh-tw, en-US: Specifies the download language.en-USis added as a fallback because some modules do not have Traditional Chinese documentation.-Force: Forces a re-download even if the local help files are already up to date.-ErrorAction SilentlyContinue: Ignores error output for failures. Some modules do not provide online help files; without this parameter, the terminal would display a large number of red error messages, though this does not affect the download of other modules.
For a complete explanation of the Updatable Help mechanism, please refer to about_Updatable_Help.
For all parameter explanations of Get-Help, please refer to Get-Help.
Example of Differences Before and After Downloading Documentation
The following is a comparison of the output of Get-Help Get-Process before and after downloading the help files.
Before downloading, only basic syntax is available, and a note at the end indicates that the help files do not exist:
NAME
Get-Process
SYNTAX
Get-Process [[-Name] <string[]>] [-Module] [-FileVersionInfo] [<CommonParameters>]
Get-Process [[-Name] <string[]>] -IncludeUserName [<CommonParameters>]
Get-Process -Id <int[]> [-Module] [-FileVersionInfo] [<CommonParameters>]
Get-Process -Id <int[]> -IncludeUserName [<CommonParameters>]
Get-Process -InputObject <Process[]> [-Module] [-FileVersionInfo] [<CommonParameters>]
Get-Process -InputObject <Process[]> -IncludeUserName [<CommonParameters>]
ALIASES
gps
ps
REMARKS
Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
-- To download and install Help files for the module that includes this cmdlet, use Update-Help.
-- To view the Help topic for this cmdlet online, type: "Get-Help Get-Process -Online" or
go to https://go.microsoft.com/fwlink/?LinkID=2096814.After downloading, it includes a complete description, syntax, and related links:
NAME
Get-Process
SYNOPSIS
Gets the processes that are running on the local computer.
SYNTAX
Get-Process [-FileVersionInfo <System.Management.Automation.SwitchParameter>] [-Module <System.Management.Automatio
n.SwitchParameter>] [[-Name] <System.String[]>] [<CommonParameters>]
Get-Process -IncludeUserName <System.Management.Automation.SwitchParameter> [[-Name] <System.String[]>] [<CommonPar
ameters>]
Get-Process [-FileVersionInfo <System.Management.Automation.SwitchParameter>] -Id <System.Int32[]> [-Module <System
.Management.Automation.SwitchParameter>] [<CommonParameters>]
Get-Process -Id <System.Int32[]> -IncludeUserName <System.Management.Automation.SwitchParameter> [<CommonParameters
>]
Get-Process [-FileVersionInfo <System.Management.Automation.SwitchParameter>] -InputObject <System.Diagnostics.Proc
ess[]> [-Module <System.Management.Automation.SwitchParameter>] [<CommonParameters>]
Get-Process -IncludeUserName <System.Management.Automation.SwitchParameter> -InputObject <System.Diagnostics.Proces
s[]> [<CommonParameters>]
DESCRIPTION
The `Get-Process` cmdlet gets the processes on a local computer.
Without parameters, this cmdlet gets all processes on the local computer. You can also specify a specific process b
y process name or process ID (PID), or by piping a **System.Diagnostics.Process** object to this cmdlet.
By default, this cmdlet returns a **Process** object that has detailed information about the process and supports m
ethods that let you control it. With parameters, you can change the type of information returned by this cmdlet.
- **Module**: Retrieve information for each module loaded into the process. - **FileVersionInfo**: Retrieve file ve
rsion information for the main module of the process.
> [!NOTE] > A module is an executable file or a dynamic link library (DLL) loaded into a process. A process > has o
ne or more modules. The main module is the module used to initially start the process. For > more information, see
[ProcessModule Class](/dotnet/api/system.diagnostics.processmodule).
RELATED LINKS
Online Version https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-process?view=power
shell-7.5&WT.mc_id=ps-gethelp
Debug-Process Debug-Process.md
Get-Process Get-Process.md
Start-Process Start-Process.md
Stop-Process Stop-Process.md
Wait-Process Wait-Process.md
Where-Object ../Microsoft.PowerShell.Core/Where-Object.md
REMARKS
To see the examples, type: "Get-Help Get-Process -Examples"
For more information, type: "Get-Help Get-Process -Detailed"
For technical information, type: "Get-Help Get-Process -Full"
For online help, type: "Get-Help Get-Process -Online"When do you need to install the new version?
Based on my current experience, here are a few reasons why I think it is worth installing the new version:
- AI Script Baseline: Scripts generated by AI are often based on PowerShell 6+, so they frequently fail to execute, and asking for the reason reveals it is a version issue.
- Encoding Issues: When mainstream tools write files, the UTF-8 encoding defaults to no BOM. If there are Chinese characters in the script, Windows PowerShell 5.1 will parse the script as ANSI, leading to misjudged strings, garbled text, or execution failure.
- Minimum Version Requirements for Tools: Tools like Copilot CLI explicitly require PowerShell 6+, providing only experimental support for 5.1.
- Cross-Platform Scripting Needs: If you want to create tool scripts that can be used on Windows, Linux, and macOS, PowerShell 6+ is a necessary condition.
Both can coexist, and there is no need to remove Windows PowerShell.
Change Log
- 2026-03-25 Initial document creation.
